﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Globalization;

namespace Gacn.ControleAlunos.Library.DataAccess
{
    public class CursoDataAccess
    {
        #region Get Methods

        public static DataTable GetAllCursoEntity()
        {
            SqlConnection connection = null;
            SqlCommand command = null;
            DataTable dataTable = null;


            connection = Util.GetConnection();
            connection.Open();

            command = connection.CreateCommand();
            command.CommandText = "SELECT [idCurso], [NomeCurso] FROM [tbCurso]";
            command.CommandType = CommandType.Text;

            dataTable = new DataTable();
            dataTable.Locale = CultureInfo.InvariantCulture;
            new SqlDataAdapter(command).Fill(dataTable);

            return dataTable;
        }

        public static DataTable GetAllCursoDetalhadoEntity()
        {
            SqlConnection connection = null;
            SqlCommand command = null;
            DataTable dataTable = null;


            connection = Util.GetConnection();
            connection.Open();

            command = connection.CreateCommand();
            command.CommandText = "SELECT [idCurso],[NomeCurso],[chAbrevNomeCurso],[DescCurso],[dtInsert],[flgAtivo],[obs],[idInsertUser] FROM [tbCurso]";
            command.CommandType = CommandType.Text;

            dataTable = new DataTable();
            dataTable.Locale = CultureInfo.InvariantCulture;
            new SqlDataAdapter(command).Fill(dataTable);

            return dataTable;
        }
        #endregion

        #region Insert Methods
        #endregion
    }
}
